﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FillQuestion.aspx.cs" Inherits="SGDemo.Web.FillQuestion" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>填写密保信息 - 辉煌装修信息管理系统</title>
    <link href="Styles/themes/css/chooseToOrganization.css" rel="stylesheet" type="text/css" />
    <script src="Scripts/jquery-1.7.2.min.js" type="text/javascript"></script>
    <script src="Scripts/Plugins/jquery.extensions.js" type="text/javascript"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            $('#progressBarBg,#progressBar').hide();
            $('#customPasswordQuestion').hide();
        });
        //选择密保问题
        var doSelectedIndexChanged = function () {
            if (cbPasswordQuestion.GetSelectedItem().value == '0') {
                $('#customPasswordQuestion').show();
            } else {
                $('#customPasswordQuestion').hide();
            }
        }
        //开始执行回调函数,弹出进度条
        var doBeginCallback = function () {
            $('#progressBarBg,#progressBar').show();
        }
        //回调完成
        var doCallbackComplete = function (s, e) {
            if (e.result == 'Success') {
                location.href = "ChooseToDept.aspx";
            }
        }
        //提交
        var doSubmit = function () {
            if (ASPxClientEdit.ValidateEditorsInContainerById('form1')) {
                var str = "PasswordQuestion={0}&CustomPasswordQuestion={1}&PasswordAnswer={2}&Email={3}";
                str = $.formatString(str, cbPasswordQuestion.GetSelectedItem().value, txtPasswordQuestion.GetText(), txtPasswordAnswer.GetText(), txtEmail.GetText());
                cabExecute.PerformCallback(str);
            }
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <dx:ASPxCallback ID="cabExecute" runat="server" ClientInstanceName="cabExecute" OnCallback="cabExecute_Callback">
        <ClientSideEvents CallbackComplete="doCallbackComplete" BeginCallback="doBeginCallback" />
    </dx:ASPxCallback>
    <div class="wrapper">
        <div class="content">
            <div class="header">
                <h1>请填写以下密保信息</h1>
            </div>
            <div>
               <table id="QuestionList" cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td class="evenCell">
                            密保问题：
                        </td>
                        <td class="oddCell">
                            <dx:ASPxComboBox ID="cbPasswordQuestion" ClientInstanceName="cbPasswordQuestion" runat="server" Width="200px" MaxLength="20">
                                <Items>
                                    <dx:ListEditItem Value="我手机号码的后6位？" Text="我手机号码的后6位？" />
                                    <dx:ListEditItem Value="我母亲的生日？" Text="我母亲的生日？" />
                                    <dx:ListEditItem Value="我父亲的生日？" Text="我父亲的生日？" />
                                    <dx:ListEditItem Value="我最好朋友的生日？" Text="我最好朋友的生日？" />
                                    <dx:ListEditItem Value="我儿时居住地的地址？" Text="我儿时居住地的地址？" />
                                    <dx:ListEditItem Value="我小学校名全称？" Text="我小学校名全称？" />
                                    <dx:ListEditItem Value="我中学校名全称？" Text="我中学校名全称？" />
                                    <dx:ListEditItem Value="离我家最近的医院全称？" Text="离我家最近的医院全称？" />
                                    <dx:ListEditItem Value="离我家最近的公园全称？" Text="离我家最近的公园全称？" />
                                    <dx:ListEditItem Value="我的座右铭是？" Text="我的座右铭是？" />
                                    <dx:ListEditItem Value="我最喜爱的电影？" Text="我最喜爱的电影？" />
                                    <dx:ListEditItem Value="我最喜爱的歌曲？" Text="我最喜爱的歌曲？" />
                                    <dx:ListEditItem Value="我最喜爱的食物？" Text="我最喜爱的食物？" />
                                    <dx:ListEditItem Value="我最大的爱好？" Text="我最大的爱好？" />
                                    <dx:ListEditItem Value="我最喜欢的小说？" Text="我最喜欢的小说？" />
                                    <dx:ListEditItem Value="我最喜欢的运动队？" Text="我最喜欢的运动队？" />
                                    <dx:ListEditItem Value="0" Text="自定义" />
                                </Items>
                                <ClientSideEvents SelectedIndexChanged="doSelectedIndexChanged" />
                                <ValidationSettings>
                                    <RequiredField IsRequired="true" ErrorText="必填项" />
                                </ValidationSettings>
                            </dx:ASPxComboBox>
                        </td>
                    </tr>
                    <tr id="customPasswordQuestion">
                        <td class="evenCell">
                            自定义密保问题：
                        </td>
                        <td class="oddCell">
                            <dx:ASPxTextBox ID="txtPasswordQuestion" ClientInstanceName="txtPasswordQuestion" runat="server" Width="200px" MaxLength="20"></dx:ASPxTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="evenCell">
                            密保答案：
                        </td>
                        <td class="oddCell">
                            <dx:ASPxTextBox ID="txtPasswordAnswer" runat="server" Width="200px" Password="true" MaxLength="20">
                                 <ValidationSettings>
                                    <RequiredField IsRequired="true" ErrorText="必填项" />
                                </ValidationSettings>
                            </dx:ASPxTextBox>
                        </td>
                    </tr>
                     <tr>
                        <td class="evenCell">
                            电子邮箱：
                        </td>
                        <td class="oddCell">
                            <dx:ASPxTextBox ID="txtEmail" ClientInstanceName="txtEmail" runat="server" Width="200px">
                                <ValidationSettings>
                                    <RequiredField IsRequired="true" ErrorText="必填项" />
                                    <RegularExpression ValidationExpression="\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" ErrorText="格式错误" />
                                </ValidationSettings>
                            </dx:ASPxTextBox>
                        </td>
                    </tr>
                    <tr>
                        <td colspan="2" style=" text-align:center; padding-top:5px;padding-left:40%;">
                            <dx:ASPxButton ID="submit" runat="server" Text="提交">
                                <ClientSideEvents Click="doSubmit" />
                            </dx:ASPxButton>
                        </td>
                    </tr>
               </table>
            </div>
            <div class="footer">
            </div>
        </div>
    </div>
    <div id="progressBarBg" class='background'>
    </div>
    <div id="progressBar" class='progressBar'>
        数据加载中，请稍等...
    </div>
    </form>
</body>
</html>
